#!/bin/bash
chmod 777 -R /var/www/html/Lazy-Share
apt update
echo -e "5\n69\n" | apt install -y nginx php8.3-fpm vim
mv /var/www/html/Lazy-Share/clipboard.conf /etc/nginx/sites-enabled/clipboard.conf
rm -rf /etc/php/8.3/fpm/php.ini&&mv /var/www/html/Lazy-Share/php.ini /etc/php/8.3/fpm/php.ini
chmod 777 /etc/php/8.3/fpm/php.ini
chmod 777 /etc/nginx/sites-enabled/clipboard.conf&&rm -rf /etc/nginx/sites-enabled/default
mkdir /etc/nginx/ssl&&cd /etc/nginx/ssl
openssl req -x509 -newkey rsa:4096 -sha256 -days 3650 -nodes \
-keyout "clipboard.key" -out "clipboard.crt" \
-subj "/CN=*" \
-addext "subjectAltName=DNS:clipboard"
chmod 777 -R /etc/nginx/ssl
service nginx start
service php8.3-fpm start
tail -F /var/log/nginx/access.log